<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>根据背景颜色改变文字颜色</title>
    <style>
      .container {
        position: relative;
        padding: 20px;
        width: 800px;
      }

      .title {
        font-size: 60px;
        color: #fff;
        mix-blend-mode: difference;
        position: absolute;
        top: 20px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <img src="./bg.png" />
      <div class="title">根据背景颜色改变文字颜色</div>
    </div>
  </body>
</html>
